<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
    
    <title>list</title>
    
	<script type="text/javascript" src="${pageContext.request.contextPath}/houtai/jquery.min.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
   <style type="text/css">
   .uu{
   list-style: none;
   margin:0px;
   padding:0;
   }
   .uu li{
   display: inline;
   }
   .uu li a{
  padding:5px 10px;
  text-decoration:none;
   }
   </style>
  </head>
  
  <body>
  <div>
  			<div>
  			<h1><a href="${pageContext.request.contextPath}/houtai/useradd.jsp">添加</a></h1>
  			</div>
  			<form action="${pageContext.request.contextPath}/userlist" method="post">
  				 <table border="1">
							<thead>
								<tr>
									<th>编号</th>
									<th>用户账号</th>
									<th>用户昵称</th>
									<th>用户密码</th>
									<th>手机号码</th>
									<th>性别</th>
									<th>注册时间</th>
									<th>第一次登录时间</th>
									<th>第二次登录时间</th>
									<th>第三次登录时间</th>
									<th>第四次登录时间</th>
									<th>登录次数</th>
									<th>操作</th>
								</tr> 
							</thead>
							
							<tbody>
								<c:forEach items="${list }" var="user">
									<tr>
										<td>${user.id }</td>
										<td>${user.username }</td>
										<td>${user.nickname }</td>
										<td>${user.password }</td>
										<td>${user.phonenumber }</td>
										<td>${user.sex }</td>
										<td>${user.zhucetime }</td>
										<td>${user.loginTime }</td>
										<td>${user.loginTime2 }</td>
										<td>${user.loginTime3 }</td>
										<td>${user.loginTime4 }</td>
										<td>${user.lognum }</td>
									 	<td>

								<a href="${pageContext.request.contextPath}/usereditget?id=${user.id}">修改</a>
								
									<a href="javascript:if(confirm('您确定要删除?')){window.location='${pageContext.request.contextPath}/userdel?id=${user.id}&currentPage=${requestScope.page.currentPage}'}">
									 删除
									</a>				
										</td> 
									</tr>
								</c:forEach>
							</tbody>
				</table>
				</form>
						<div>
							共 ${requestScope.page.totalSize } 条记录
							<div>
								<ul class="uu">
									<span>${requestScope.pageString }</span>
								</ul>
							</div>
						</div>
						<br>
		<input type="hidden" value="${requestScope.page.totalPage }" id="totalPage"/>
		</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$('.page_s').on('click',function(){
				var count = $(this).attr('lang');
				if (count <= parseInt($('#totalPage').val()) && count >= 1){
		window.location.href="${pageContext.request.contextPath}/userlist?currentPage="+count;
			}
			});
			
	
		});
	</script>
  </body>
</html>
